UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l9vFOTfehuxD6SqFN7H/4TkAZRGJjqnLAfgZGe/r0hs='
WHERE
key_id = 'c6bfcc5b73d6e38633c84c7faecfb266e4c0e4a45a46337cee633d3106163a3c'
AND (
token = 'l9vFOTfehuxD6SqFN7H/4TkAZRGJjqnLAfgZGe/r0hs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)