UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'laI3qp6LQfQefkiwBGw4EFW9IR2aM0Rr+pFhLMjccbs='
WHERE
key_id = '046e336d25090198143a7686e9aa59ef88d27a1e7b6f5507d84d2d43bf15c448'
AND (
token = 'laI3qp6LQfQefkiwBGw4EFW9IR2aM0Rr+pFhLMjccbs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)