UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xij2DcKC9dvGi+yF4XhvrQHvHEyl2iKW/FFTWfvRb6k='
WHERE
key_id = 'd96049f3efa6796e47166a4a4ab59c068fb71eb09b389b98c721673362d7c8d7'
AND (
token = 'Xij2DcKC9dvGi+yF4XhvrQHvHEyl2iKW/FFTWfvRb6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)