UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eVhUPa5ZNPo7k+kncD3dsVgyCe257qQ8mkLffndhwDw='
WHERE
key_id = '02caf0f46c079a1fa31629b8f48ecbc1d0fff273a573f3b723daf22b3acbf93c'
AND (
token = 'eVhUPa5ZNPo7k+kncD3dsVgyCe257qQ8mkLffndhwDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)