UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5rNjueX+8U1nVybqDD2AikqdnQGH+2ZwfYbcDya19F0='
WHERE
key_id = '2192c3c7c51803f87dfd05f0d593469cb048d1c4bac08255b3c199f1c63feb3c'
AND (
token = '5rNjueX+8U1nVybqDD2AikqdnQGH+2ZwfYbcDya19F0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)