UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'adFWTH8u+uwKu76/xh+IHHboPHBeOUG/xjaCaJapXfg='
WHERE
key_id = 'f9cdcb2bc90ba752cf1cfd674b434a0c6a4b1f62bf8c746344e0c54fa9655f1c'
AND (
token = 'adFWTH8u+uwKu76/xh+IHHboPHBeOUG/xjaCaJapXfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)