UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KjqCkou5Q9ND0V2KLDJNp5gjfgIPLl6wiPTSe6H05XY=' 
WHERE 
  key_id = '5d126d47a641b39f9675ba851eb35d63565a011241fcb6df1b5469240db0617a' 
  AND (
    token = 'KjqCkou5Q9ND0V2KLDJNp5gjfgIPLl6wiPTSe6H05XY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017