UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2XfFR6xA1+M+hYVjW+90vXi/fs5w501dql3X+HVlZg0='
WHERE
key_id = '721e33d460b9f711c8bf9cf3c9e09e0b7a47a52009e4000d39caa4fac9b2aeb4'
AND (
token = '2XfFR6xA1+M+hYVjW+90vXi/fs5w501dql3X+HVlZg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)