UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f2MRs5h7V9OdO35ewqt3x9WhI8p1fAYVg/7SqSZ7wcA=' 
WHERE 
  key_id = 'd83e531ef46aa6ed26f48db44b8b555d29c6c388ff2ad22c32f10d8c706c882a' 
  AND (
    token = 'f2MRs5h7V9OdO35ewqt3x9WhI8p1fAYVg/7SqSZ7wcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037