UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Ajq/tujzhM9DPTDMvfq2VEu1/wHVwj1JrIj/5Hfd9k='
WHERE
key_id = '0a7649e966decf8ec9188ab14dc26695454a2484bc1c5215ecc6194218b42778'
AND (
token = '/Ajq/tujzhM9DPTDMvfq2VEu1/wHVwj1JrIj/5Hfd9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)