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

Query time 0.00020