UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6M1SczEbMgHYjejoXlFmGcioNx5wPWGUDo+mF/KFF70='
WHERE
key_id = '2afbf3b836da9d1e1a128c6288a10cb1bd101fd20092266a3f16c8b908162100'
AND (
token = '6M1SczEbMgHYjejoXlFmGcioNx5wPWGUDo+mF/KFF70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)