UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z6bg/iAt9US4wjgpNF2aolBbugcHuIehBzwzIzV/LGA='
WHERE
key_id = '22ec815aacf55c799682cbd7e39063d73ccb0c5d138ece4d4c44b3f465505703'
AND (
token = 'z6bg/iAt9US4wjgpNF2aolBbugcHuIehBzwzIzV/LGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)