UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JMJGA1NImFBuX/EBa7FY/ZLe/8x0Xezwmtffdg1Myc4=' 
WHERE 
  key_id = '556b454edf2876306b34022d3e802d5a77fbccd7bbda13b8a46b426f067bf181' 
  AND (
    token = 'JMJGA1NImFBuX/EBa7FY/ZLe/8x0Xezwmtffdg1Myc4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022