UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xb6UOoJvey+ixfAD8LkWX9IBYOu2e+qqPF9X35gOq1M=' 
WHERE 
  key_id = '0c3397eb65db39d7d6e9a60a550596ca1e618814ee4eb52d24bc228d5c7e9b22' 
  AND (
    token = 'xb6UOoJvey+ixfAD8LkWX9IBYOu2e+qqPF9X35gOq1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039