UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pjZyu94ZPcoFxe2AZ+/mxhbRSYfbqL3cHz9Krjhsq1Y=' 
WHERE 
  key_id = '6bcfe557445495752ed9af9d2bfb52242bf454b7fe672cd3f6c59038063dca35' 
  AND (
    token = 'pjZyu94ZPcoFxe2AZ+/mxhbRSYfbqL3cHz9Krjhsq1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029