UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8LaNoO05vjQZO6+yzCyDOnDcRuxZ+hOiT5qTj9ODAXo='
WHERE
key_id = '0af22fe8b47858b636d26d71b1d87ec3507a6ae2f67ce5a0de97a88495833ec9'
AND (
token = '8LaNoO05vjQZO6+yzCyDOnDcRuxZ+hOiT5qTj9ODAXo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)