UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EuspbBhnKYMLxZjrBHXLUVpHyyTTcXpS6g/nj6V1aN8='
WHERE
key_id = 'add79e313497cb599bf154473e4dd9078fa8c588bf4d2e14f2c9498a75572008'
AND (
token = 'EuspbBhnKYMLxZjrBHXLUVpHyyTTcXpS6g/nj6V1aN8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)