UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5nrbIo93sXmXeZUXNaTVfnBQqglgo8RCxNUp+GiqPww='
WHERE
key_id = 'ac644a29a5d1cf600102a9e63d878bdec0b391944fd0aad382fcefa825ea52d1'
AND (
token = '5nrbIo93sXmXeZUXNaTVfnBQqglgo8RCxNUp+GiqPww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)