UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mNrPM576E6s925MnZmH1pV5hDaYqcBwABb0FA6YNYXg=' 
WHERE 
  key_id = '9fc4dba37e4c2bd4b376ff491112006a6623196f9ddc4375e065eefaa91b4fa4' 
  AND (
    token = 'mNrPM576E6s925MnZmH1pV5hDaYqcBwABb0FA6YNYXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044