UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YD93nSnhCtbpr1DRN0OQsR7genhP5xZLVhGK2/9r4cY=' 
WHERE 
  key_id = 'e3771df66012079f58294e23b61ea7a99e3fd933e5af6a40bbf101fe9b37c04b' 
  AND (
    token = 'YD93nSnhCtbpr1DRN0OQsR7genhP5xZLVhGK2/9r4cY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052