UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DqFICiggsW9cIEjwEELyCiLD1GIPm/dlD68KuIDh+G0='
WHERE
key_id = 'a0ce42a9650b2f1dad3ef26f10ded88c54066d041a08d4f3c5b4654f710eaf79'
AND (
token = 'DqFICiggsW9cIEjwEELyCiLD1GIPm/dlD68KuIDh+G0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)