UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g5wiPkjFGym3WpTiRhxjb2hd4UDWATjYDA14KALdUFo='
WHERE
key_id = 'd8ac204beb2ea432dcef3e1e7c7a2aa324f8920e62dfabd817d2a4227587dabb'
AND (
token = 'g5wiPkjFGym3WpTiRhxjb2hd4UDWATjYDA14KALdUFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)