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

Query time 0.00040