UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OH1fhhOS9QpGXGAF1UpgRdqHuLUgeRAzhvlvShIdgy8=' 
WHERE 
  key_id = '90c16af45a4f5cb612bab4fec4d8f1fabeccb8ec5835e636071e2d60e2aad96e' 
  AND (
    token = 'OH1fhhOS9QpGXGAF1UpgRdqHuLUgeRAzhvlvShIdgy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022