UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pv7EHPk+guwwhUW4QrVIQeEmXVObFVuc775W4MDM1pY='
WHERE
key_id = '346110a407ba5d73929d5f0d6778ddc7f5260c98325386bb7597e762ce0d2b6c'
AND (
token = 'Pv7EHPk+guwwhUW4QrVIQeEmXVObFVuc775W4MDM1pY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)