UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SWWvkKnAn0gLKeSgfHjBBq67jRbhq51qELOCIpcl0ho=' 
WHERE 
  key_id = 'e9c58969c307abafbe20c9486890c426f07d9d1f64f7d513f43625ea75cc0cbb' 
  AND (
    token = 'SWWvkKnAn0gLKeSgfHjBBq67jRbhq51qELOCIpcl0ho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031