UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yc3VxPfxhp9QMWMaOQbcWAQeXI9w5Kw5FWh/fdJkVRU='
WHERE
key_id = 'bcf3c1442333fc6b94d039d374c07b1c8985d5ae43cc1b0d33b4883c056a7397'
AND (
token = 'Yc3VxPfxhp9QMWMaOQbcWAQeXI9w5Kw5FWh/fdJkVRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)