UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nGs7ERgIGIfQNnWPDZrD8fTZjRrkmdCoiHrW5yTuR/E=' 
WHERE 
  key_id = '7a2b09a0eae0c6c0e1a574424a32c022019e8ba881c2bc0cedaeb0387d9662a9' 
  AND (
    token = 'nGs7ERgIGIfQNnWPDZrD8fTZjRrkmdCoiHrW5yTuR/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038