UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SqvrQvrMx8wPcq9Iyy7Qjy0/AGW8Kh7C/p4fbgx0i3w='
WHERE
key_id = 'febe68a5116039d0666c8dba45452869736995f03b85a840ee58a3f527f15fcb'
AND (
token = 'SqvrQvrMx8wPcq9Iyy7Qjy0/AGW8Kh7C/p4fbgx0i3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)