UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L0lit5GbcIj9/VzaZJz5ZTOo1q5Xb44DRqi1lS/HLFY='
WHERE
key_id = '0ce53ec2da6aa609237fff3092fadb65f2f0e196ade2cc058777486d2a4c4ef9'
AND (
token = 'L0lit5GbcIj9/VzaZJz5ZTOo1q5Xb44DRqi1lS/HLFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)